package com.sh.shanhuo.database.sort;

import java.util.List;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

@Dao
public interface SortInfoDao {

    @Query("SELECT * FROM sort_info")
    List<SortInfoEntity> queryAll();

    @Query("SELECT * FROM sort_info WHERE sortName LIKE :sortName")
    SortInfoEntity findBySortId(String sortName);


    @Insert(onConflict = OnConflictStrategy.REPLACE)
    Long insert(SortInfoEntity sortInfoEntity);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    List<Long> insertAll(List<SortInfoEntity> sortInfoEntities);

    @Update()
    int update(SortInfoEntity sortInfoEntity);

    @Update()
    int updateAll(SortInfoEntity... sortInfoEntities);

    @Update()
    int updateAll(List<SortInfoEntity> sortInfoEntities);

    @Delete
    int delete(SortInfoEntity sortInfoEntity);

    @Delete
    int deleteAll(SortInfoEntity... sortInfoEntities);

    @Delete
    int deleteAll(List<SortInfoEntity> sortInfoEntities);



}
